import Vue from 'vue'
import App from './App'


//全局处理重复页面跳转详情初始化,和详情跳详情返回的bug
import MyPlugin from './minxins'
Vue.use(MyPlugin)

// 引入iconfont库
import '@/resources/iconfont/iconfont.css'

//引入store
import store from './store/index'
//把store挂载到全局
Vue.prototype.$store = store;

// 引入LeanCloud的SDK
// 图南鸟
// var APP_ID = '8J0hrsnXgeP4tjBrS7T4d1MR-gzGzoHsz';
// var APP_KEY = '67vePTxUmsKH6YaHjtKRyic8';

//纤纸洁
var APP_ID = 'xG5WxVnAqmwDCVO8AfunLjlo-gzGzoHsz';
var APP_KEY = 'Gc98QTjlIQr5C4x2ie59cpTb';
var AV = require('leancloud-storage');

// 初始化LeanCloud参数
AV.init({
  appId: APP_ID,
  appKey: APP_KEY
});

AV.User.loginWithWeapp().then(user => {
    let userInfo = user.toJSON(); // LeanCloud返回的用户数据
    wx.setStorageSync('userInfo',userInfo)
    var openId = userInfo.authData.lc_weapp.openid
    wx.setStorageSync('openId',openId)
    // console.log(userInfo)
    // console.log(openId)

})
 

Vue.config.productionTip = false
App.mpType = 'app'

const app = new Vue(App)
app.$mount()
